package com.br.unisal.library.exception;

public class ArgumentValidator {

	public static void validateNullValue(Object object) 
			throws IllegalArgumentException, NullValueException {	
		if(object == null || "".equals(object)) {
			throw new NullValueException();
		}
	}
	
	public static void validateNumber(Object object) 
		throws NumberFormatException {
		String objectString = object.toString();
		
		for (char c : objectString.toCharArray())
	    {
	        if (!Character.isDigit(c)){
	        	throw new NumberFormatException();
	        }
	    }
	}
}
